import request from '@/router/axios';
import {
    baseUrl,
    mockUrl,
} from '@/config/env';

export const getList = () => request({
  url: `${baseUrl}/app/bindOwner/bingCommunityMessage`,
  method: 'get',
});
export const setDefaultHouse = (userId, houseId) => request({
  url: `${baseUrl}/app/bindOwner/setDefaultHouse`,
  method: 'get',
  params: {
      userId,
      houseId,
    },
});

export const getBuildingList = communityId => request({
  url: `${baseUrl}/app/bindOwner/buildingList`,
  method: 'get',
  params: {
      communityId,
    },
});
export const getUnitList = buildingId => request({
  url: `${baseUrl}/app/bindOwner/unitList`,
  method: 'get',
  params: {
      buildingId,
    },
});
export const getHouseList = unitId => request({
  url: `${baseUrl}/app/bindOwner/houseList`,
  method: 'get',
  params: {
      unitId,
    },
});
export const addCommunity = query => request({
  url: `${baseUrl}/app/bindOwner/bindHouse`,
  method: 'post',
  data: query,
});

export const getCommunityList = () => request({
  url: `${baseUrl}/app/bindOwner/communityList`,
  method: 'get',
});
